//号称nodejs异步编程的终极产物async await
//获取超市名称
function getShopName(){
	var shopName='好日子';
	return new Promise(function(resolve,reject){
		resolve(shopName);
	});
}
//获取商品价格
function getGoodPrice(shopName){
	if(shopName=='好日子'){
		var price=60;
	}else{
		var price=20;
	}
	return new Promise(function(resolve,reject){
		resolve(price);
	});
}
async function getStockPrice(){
	var shopName=await getShopName();
	var price=await getGoodPrice(shopName);
	return price;
}
getStockPrice().then(function(v){
	console.log(v);
});
//getStockPrice();
